home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qprogressdialog.h.z / qprogressdialog.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.4 KB  |  90 lines

  1. /****************************************************************************
  2. ** $Id: qprogressdialog.h,v 2.15 1998/07/03 00:09:29 hanord Exp $
  3. **
  4. ** Definition of QProgressDialog class
  5. **
  6. ** Created : 970520
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QPROGRESSDIALOG_H
  25. #define QPROGRESSDIALOG_H
  26.  
  27. #ifndef QT_H
  28. #include "qsemimodal.h"
  29. #include "qpushbutton.h"
  30. #include "qlabel.h"
  31. #include "qprogressbar.h"
  32. #endif // QT_H
  33.  
  34. struct QProgressData;
  35.  
  36.  
  37. class QProgressDialog : public QSemiModal
  38. {
  39.     Q_OBJECT
  40. public:
  41.     QProgressDialog( QWidget *parent=0, const char *name=0, bool modal=FALSE,
  42.              WFlags f=0 );
  43.     QProgressDialog( const char *labelText, const char *cancelButtonText,
  44.              int totalSteps, QWidget *parent=0, const char *name=0,
  45.              bool modal=FALSE, WFlags f=0 );
  46.    ~QProgressDialog();
  47.  
  48.     void    setLabel( QLabel * );
  49.     void    setCancelButton( QPushButton * );
  50.     void    setBar( QProgressBar * );
  51.  
  52.     bool    wasCancelled() const;
  53.  
  54.     int        totalSteps() const;
  55.     int        progress()   const;
  56.  
  57.     QSize    sizeHint() const;
  58.  
  59. public slots:
  60.     void    cancel();
  61.     void    reset();
  62.     void    setTotalSteps( int totalSteps );
  63.     void    setProgress( int progress );
  64.     void    setLabelText( const char * );
  65.     void    setCancelButtonText( const char * );
  66.  
  67. signals:
  68.     void    cancelled();
  69.  
  70. protected:
  71.     void    resizeEvent( QResizeEvent * );
  72.     void    styleChange(GUIStyle);
  73.  
  74. private:
  75.     void       init( QWidget *creator, const char* lbl, const char* canc,
  76.                  int totstps);
  77.     void       center();
  78.     void       layout();
  79.     QLabel      *label()  const;
  80.     QProgressBar  *bar()    const;
  81.     QProgressData *d;
  82.  
  83. private:    // Disabled copy constructor and operator=
  84.     QProgressDialog( const QProgressDialog & );
  85.     QProgressDialog &operator=( const QProgressDialog & );
  86. };
  87.  
  88.  
  89. #endif // QPROGRESSDIALOG_H
  90.